UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't/i8kzcAGV1Lbs6bgg71ZPoRIQRvUktE+hcB33cwhCM='
WHERE
key_id = '554677c08f78f37e4dafbce7892beea1a0967c86f8b065f9d2f410881f68c29a'
AND (
token = 't/i8kzcAGV1Lbs6bgg71ZPoRIQRvUktE+hcB33cwhCM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)