UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jomZDH70pU1xkb7+PtkG5n34uMUhF5BnSa0h6g8MjKw=' 
WHERE 
  key_id = '9135633831c2117a2ebfc4f722e73fd3b161adb316c1e84130530690c4218f55' 
  AND (
    token = 'jomZDH70pU1xkb7+PtkG5n34uMUhF5BnSa0h6g8MjKw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030