UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '54HqJupYWWoQmVaZ/v9tcZRDTpGrH6Lq4Hp9hVoAZcE='
WHERE
key_id = '89a9717f3d4031ff8d8450d8bd04e9d74512ad1468f972e2439973ac4056bfd1'
AND (
token = '54HqJupYWWoQmVaZ/v9tcZRDTpGrH6Lq4Hp9hVoAZcE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)