UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3Rq57f5HMTNS+jztLTBBUg5eauyjbWkhQ9f9Ud5Mwsc='
WHERE
key_id = '82d7c32c510617828485c2aa28cfe78a387ab232424975c3d288f0fe6171ffd6'
AND (
token = '3Rq57f5HMTNS+jztLTBBUg5eauyjbWkhQ9f9Ud5Mwsc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)