UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '65gIGywh+samEvMDSvGhHZSXgKn/pddY6tM5PLlMPu4='
WHERE
key_id = '1b8a12ab9bbf20640a4fe36fd6ca729e6f054e9df980e9871fd7024a68e24127'
AND (
token = '65gIGywh+samEvMDSvGhHZSXgKn/pddY6tM5PLlMPu4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)