UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6J9ZHxzhSBPXArDBD7iLmhMoaBDgp3k5/q4390X795Y=' 
WHERE 
  key_id = '9915a561b63c84d99ba5d2dfcdb3dfef85e64fd353938913aad236e064c58fa3' 
  AND (
    token = '6J9ZHxzhSBPXArDBD7iLmhMoaBDgp3k5/q4390X795Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023