UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B/xW94eoZcPwxPsMwk2nY2VhCxDqEo0+ivxDPfeC7oY='
WHERE
key_id = '95a781a6fc1b3d01943473893748337fcc8c11b1c9da7719194bc6455d74977c'
AND (
token = 'B/xW94eoZcPwxPsMwk2nY2VhCxDqEo0+ivxDPfeC7oY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)