UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tsMaAK3oIuOAApbjzkkN6LuiWMQmRv4u3qQ8tBhw9Sk='
WHERE
key_id = '86e0e2ea0e698cdae68189e0c4bfd0a9b1040722028bb33caddaaf79acbf69ff'
AND (
token = 'tsMaAK3oIuOAApbjzkkN6LuiWMQmRv4u3qQ8tBhw9Sk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)