UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F86NP/qfm0djMxaZKu9NU2hy3h9DJWGF/gWtbTbs+n0=' 
WHERE 
  key_id = 'a6958707ae4a5efcd5dd97410cc051e16cc2785a720bec227362bc3a81b2ae74' 
  AND (
    token = 'F86NP/qfm0djMxaZKu9NU2hy3h9DJWGF/gWtbTbs+n0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022