UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZVdUK4pAS5+1pRMY6veIozdTOB9/t6DDg0DvbLe7YQs='
WHERE
key_id = '22b55e5d9679ac02045de15b151f75a66cf0f492b4c3c48984b8b57fa16217f7'
AND (
token = 'ZVdUK4pAS5+1pRMY6veIozdTOB9/t6DDg0DvbLe7YQs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)