UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AysObFqCjeTFFc3MWFipo2FKJ2j4bjmwcjshkGhVs+k='
WHERE
key_id = '114bb3ea99008be4f41a5992d50c445e8e5be5c4c9c1c58d8b59466b2bcd09a9'
AND (
token = 'AysObFqCjeTFFc3MWFipo2FKJ2j4bjmwcjshkGhVs+k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)