UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sAjsIneRRh7fwANZc5SJrbaz4xLE6Rr4nsy2UV36+ew=' 
WHERE 
  key_id = 'c23f89d6f187588dcfc222641d757dc0d4e7f2d7179c98dc7a9e3b37a0a45a6d' 
  AND (
    token = 'sAjsIneRRh7fwANZc5SJrbaz4xLE6Rr4nsy2UV36+ew=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021