UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2OLLsxzRplV8L8MD2xA97zh7O3XXUGAASMQOIbHtpZk='
WHERE
key_id = 'c5a7deec7bc4a60f154cd58ffe2d0e156901f55b3da959a8fccc7882796a54d3'
AND (
token = '2OLLsxzRplV8L8MD2xA97zh7O3XXUGAASMQOIbHtpZk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)