UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l88DwczD5RttwqER013JVdM0m/5/3qBBs2G0FB0RnQ0=' 
WHERE 
  key_id = '383bc8b8a9cdefd43958a03f2f97d0c1dfcea70fbaddb09e3715da83772b1b95' 
  AND (
    token = 'l88DwczD5RttwqER013JVdM0m/5/3qBBs2G0FB0RnQ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023