UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I1uSGCy2aeMRPxhOq944AFCjuMmhV9jIvi0IyPIYShM='
WHERE
key_id = '9db157a3eaecc0a4287e0e87bf0f51cb668f7f8d65b01be46fd86589a2c20516'
AND (
token = 'I1uSGCy2aeMRPxhOq944AFCjuMmhV9jIvi0IyPIYShM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)