UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fylbmLZ7DUojOASQZgYnDHSXANdV6rr7C+OR5iKEJVs=' 
WHERE 
  key_id = '73b9b2777cc936ccb3f33be022de5668f8007135f7e7c56973e818d320e7bdc5' 
  AND (
    token = 'fylbmLZ7DUojOASQZgYnDHSXANdV6rr7C+OR5iKEJVs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030