UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u4o2Dq2ndGlj3Z1EAjdpN0qV0ZRcy9v/gGa1YbUT89w='
WHERE
key_id = '79839706473fe8aa8d819d902c2a210f251502fd1b1411d97d4a302a48c1f30b'
AND (
token = 'u4o2Dq2ndGlj3Z1EAjdpN0qV0ZRcy9v/gGa1YbUT89w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)