UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KzTx8w/5fbOhRkb2AvmptRSumfEzQWLWbKxg8+lVdjo='
WHERE
key_id = '3c02a71ea33ae26b297790aba9a94ce13e3be45cb16c2b0ac9546d7fdb811888'
AND (
token = 'KzTx8w/5fbOhRkb2AvmptRSumfEzQWLWbKxg8+lVdjo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)