UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6a60M7cbSLGEn/2mnv4RJtbIxspf6VRJRQ+Oc8fTVPQ=' 
WHERE 
  key_id = 'bd184a51ce618b38370c1bd2396e0d82273f289e662290286969bcfb3c9ee6fc' 
  AND (
    token = '6a60M7cbSLGEn/2mnv4RJtbIxspf6VRJRQ+Oc8fTVPQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030