UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1OnEqSR1JG3BLu9rgfb/jNonwZy1Bo15ydh63MvqxmI='
WHERE
key_id = '7f02a051434578a9ea3672d6edbe8145a9058b758ac1f5c76289467b7115c23d'
AND (
token = '1OnEqSR1JG3BLu9rgfb/jNonwZy1Bo15ydh63MvqxmI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)