UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IgpE5m8lDOQ+J45AZ06DdiuNp/rYrWiAKNS1Vzp6UIY=' 
WHERE 
  key_id = '14ff72869acfd39820dd1ee5208590286af3943b77feeb83b5468db330caa04e' 
  AND (
    token = 'IgpE5m8lDOQ+J45AZ06DdiuNp/rYrWiAKNS1Vzp6UIY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024