UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mMKxO484o5y3W8ztIU0QV72gqWaHuSrrAkHSfVBoObo=' 
WHERE 
  key_id = 'd80c68e010423de4d0b084345f58bbd7143d4975f1a405cc8aa64d69ff5e64c8' 
  AND (
    token = 'mMKxO484o5y3W8ztIU0QV72gqWaHuSrrAkHSfVBoObo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041