UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ApvSCt+Wl6tR4+33zMAVrERoihaHaZOWWzZhl8vWa8I='
WHERE
key_id = '690c260ce4cba11cf6b23211941ef01b459df8efaf32af464f1cea13f2cee6ad'
AND (
token = 'ApvSCt+Wl6tR4+33zMAVrERoihaHaZOWWzZhl8vWa8I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)