UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JCeyVlXJ4PrL7LfcUPZ/Y3X/PZ9+Xcy3RmPtr6kv2Pc='
WHERE
key_id = '7bfe376797b08e1756c9bf84e4cfb54cc947c19553d92e6d6db7b5cde5dc82f2'
AND (
token = 'JCeyVlXJ4PrL7LfcUPZ/Y3X/PZ9+Xcy3RmPtr6kv2Pc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)