UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gCc4q0MaT8D6fThW/CumvvqhmJ1rSN/kcIYrYrpW5aI=' 
WHERE 
  key_id = '1627bcbb9900c799a8dc9d7a6f798f554425124f44cc37a95f2748240addba9f' 
  AND (
    token = 'gCc4q0MaT8D6fThW/CumvvqhmJ1rSN/kcIYrYrpW5aI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023