UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eXax3VXSDJG/sk72hALjDhIOvr66XWpv+rwqh6vTirE='
WHERE
key_id = '1c7939a8033f004ebc3c1b47b70949d7386c4fdff8afb24b26c4c2ed15e95038'
AND (
token = 'eXax3VXSDJG/sk72hALjDhIOvr66XWpv+rwqh6vTirE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)