UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B7rGIiMmzYws+iu7p1z+gFk1IPsY/sOVkiCKGmB3FQc='
WHERE
key_id = 'c6ce462a4df7cbbf60e8b34aa9aaa1f9efa5b81b7ac15889f848ecbbda356d73'
AND (
token = 'B7rGIiMmzYws+iu7p1z+gFk1IPsY/sOVkiCKGmB3FQc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)