UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0NybdskQQTTf5TpgxmZkK+0cBPVr4MSjaRy6ttBq/e8='
WHERE
key_id = 'ce2ce988e32bc77f0ac9367ba569d924f1a856cbbd83b6bab5d5188bbe3c51e2'
AND (
token = '0NybdskQQTTf5TpgxmZkK+0cBPVr4MSjaRy6ttBq/e8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)