UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b4oxc0T7X/YSuLnCngrXHlVz31E2pxNMA8VY7Lvd5pg='
WHERE
key_id = '5392defa1c9de743b0dba69bc5e18211ff3e322e7809469ddc8495ab9b17f45d'
AND (
token = 'b4oxc0T7X/YSuLnCngrXHlVz31E2pxNMA8VY7Lvd5pg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)