UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R4uJEMXBfQLhG9M6cbHxeOFGP6aSS03nh5TZHvWjVlY='
WHERE
key_id = '65e3cac357a1bc987485280dbe07a2406d0446939233b726ddc19d86ffba4fe6'
AND (
token = 'R4uJEMXBfQLhG9M6cbHxeOFGP6aSS03nh5TZHvWjVlY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)