UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8OS+1e1/ACvw0shTd0HhJIoQ++1rSNdqThI5FlydHqQ='
WHERE
key_id = 'bfc56fde3fa522e7430fb72fb80e37e429a724c96795fa39f8b646f170ff177f'
AND (
token = '8OS+1e1/ACvw0shTd0HhJIoQ++1rSNdqThI5FlydHqQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)