UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u1v5hAAkLzUzJLx9ne919RxhxU6FWY6jAbJPKi50Q4w=' 
WHERE 
  key_id = '75909f33ad85acf5b9333f56e3ae173d976f0e4c355d2bbaf90a4c28f6429587' 
  AND (
    token = 'u1v5hAAkLzUzJLx9ne919RxhxU6FWY6jAbJPKi50Q4w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020