UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+PqFG2HIEfK0KEc4yoXnL9pT/cnkOiSFfJ0yAnG6gQU='
WHERE
key_id = '3f186fc81f603806ae212d8a697b55bc683c4e311b8ebf2e7f05f058fb25fc05'
AND (
token = '+PqFG2HIEfK0KEc4yoXnL9pT/cnkOiSFfJ0yAnG6gQU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)