UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5yKCRwxCKNOO3bbYdxbp5P5w86roOEQbt3Fk1K16oWA='
WHERE
key_id = '139ef1416ab44ee608b1d072f71ffc9b93ec5cf6250f5b0844f31eec05a33c76'
AND (
token = '5yKCRwxCKNOO3bbYdxbp5P5w86roOEQbt3Fk1K16oWA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)