UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mhne+519ORdkb8fYUOQcI3oT21bQG5yisgNd3+ZoYTA='
WHERE
key_id = 'ccd3f5846c2ca46ff8ba57f83613f5ccb30a73ffa845ea19502c59f0a52c3341'
AND (
token = 'mhne+519ORdkb8fYUOQcI3oT21bQG5yisgNd3+ZoYTA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)