UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'odQYSF5xSjQ/IW5GjmTFZgA263FGtQugGFt1fBfkFTE='
WHERE
key_id = 'd42f55303072e8007d3e640b7d7f3d09e2b1d6a54a80129bf32eb992ccffe45d'
AND (
token = 'odQYSF5xSjQ/IW5GjmTFZgA263FGtQugGFt1fBfkFTE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)